﻿@model IEnumerable<Back_end.Models.Company>

@{
    ViewBag.Title = "企业管理";
}

<h2>@ViewBag.Title </h2>

<p>
    @Html.ActionLink("添加企业", "Create")
</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Introduction)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Location)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ComplaintCount)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <th>
            @Html.DisplayFor(modelItem => item.Name)
        </th>
        <td>
			@{ var intr = item.Introduction.Length > 10 ? item.Introduction.Substring(0, 7) + "..." : item.Introduction; }
			@intr
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Location)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ComplaintCount)
        </td>
        <td>
            @*@Html.ActionLink("编辑", "Edit", new { id=item.Name }) |*@
            @Html.ActionLink("详细", "Details", new { id=item.Name }) |
            @Html.ActionLink("删除", "Delete", new { id=item.Name })
        </td>
    </tr>
}

</table>
